﻿@page "/generalupdate_aspnetcore"

<h3>GeneralUpdate.AspNetCore</h3>


<div>
    <Tab IsBorderCard="true">
        <TabItem Text="使用">
            <div>
               @use_string
            </div>
        </TabItem>
        <TabItem Text="详细">
            <div>
                <Markdown Height="500" IsViewer="true" Value="11111111111111111111111"></Markdown>
            </div>
        </TabItem>
        <TabItem Text="Tab3">
            <div>
                <h1>Tab3</h1>
            </div>
        </TabItem>
    </Tab>
</div>

@code {
    private string use_string = 
        @"static void Main(string[] args)
        {
            var resultBase64 = args[0];
            var bootstrap = new GeneralUpdateBootstrap();
            bootstrap.Exception += OnException;
            bootstrap.MutiDownloadError += OnMutiDownloadError;
            bootstrap.MutiDownloadCompleted += OnMutiDownloadCompleted;
            bootstrap.MutiDownloadStatistics += OnMutiDownloadStatistics;
            bootstrap.MutiDownloadProgressChanged += OnMutiDownloadProgressChanged;
            bootstrap.MutiAllDownloadCompleted += OnMutiAllDownloadCompleted;
            bootstrap.Strategy<DefaultStrategy>().
                //下载超时时间（单位：秒）,如果不指定则默认超时时间为30秒。
                Option(UpdateOption.DownloadTimeOut, 60).
                RemoteAddressBase64(resultBase64).
                LaunchAsync();
            Console.Read();
        }";
}